1. Field of the Invention
The present invention relates to the field of computer controlled display systems, in particular, interpolation for use in rendering pixels for displaying 3-dimensional graphical images.
2. Description of the Related Art
As the processing capability of computer systems has grown, so have the ways of displaying data generated by the computer systems. Many vocations now use computer systems as a fundamental tool. For example, in the area of architectural design, 3-Dimensional graphical images (or 3-D images) of buildings or other structures are dynamically created and manipulated by a user. A computer system is able to capture and process data in order to display the 3-D image, in a time that is much faster than could be done manually. As computer hardware technology has advanced, so has the development of various methods, techniques and special purpose devices for rapidly displaying and manipulating 3-D images. An exemplary 3-D rendering system is described in co-pending application Ser. No. 07/811,570 now U.S. Pat. No. 5,345,541, entitled "Method and Apparatus For Simultaneously Rendering Multiple Scanlines", which is assigned to the assignee of the present application.
A 3-D image is represented in a computer system as a collection of graphical objects, e.g. polygons. Each of these polygons is spatially defined as a set of points. Associated with each point are pixel shading values. Identification of other points within the polygon is typically done by linear interpolation of the given set of points.
Performing the linear interpolation calculations for each point is very compute intensive. To minimize computation the rendering is typically done using a forward differencing calculation. Consider the case of interpolating to find pixel shading values across a row or span of an object. In forward differencing, a constant, say .DELTA.p is determined that is between each horizontal coordinate (e.g. using the formula .DELTA.p=P1-P0/Y1-Y0, where P1 and P0 are pixel shading values at endpoints Y1 and Y0 of an edge). Thus, when calculating pixel shading values across a row, the next pixel shading value may be determined by simply adding .DELTA.p to the previous pixel shading value.
The forward differencing technique i premised on the idea that it is desirable to minimize the number of complications that need to be performed. The tradeoff is that a larger amount of data must be moved and stored within the system (e.g. the pixel shading values for prior pixels and the corresponding interpolation constant for each pixel shading component)
With the maturation of semiconductor technology, the cost of circuitry to perform such division operations has decreased while the speed has increased. Thus, it has become viable to design system that utilize processing power and minimize memory requirements. This is especially desirable in the design of integrated circuits where memory can take p a sizable amount of valuable space. Thus, it would be desirable to provide a method and means where these linear interpolations may be directly performed in an efficient manner.
Direct linear interpolation (LIRP) is accomplished by performing the function: EQU (1-w)A+wB.
The values A and B are the extreme/endpoint values. The value w is an interpolation weighting value in the range 0.ltoreq.w.ltoreq.1. The weighting value w specifies a linear "blend" of the values A and B. For generation of acceptable graphical images, the result of this expression must be A if w is zero and must be B if w is one. A level of error is acceptable between A and B when w is a positive fraction less than one.
It is important when performing this calculation that the result has the correct sign. One way for assuring that the result has the correct signs is to sign extend the hardware circuitry performing the calculation. Sign extension requires that each adder, multiplier; multiplexer, etc. be extended in high bits by replicating the sign to align with the sign bit of the result. Extended width operands, are wasteful in many instances. Thus it is desirable to provide an efficient and fast method and means for directing calculating the signed LIRP function without sign extension.